import * as React from 'react';
import { withRouter } from 'react-router-dom';
import { DefaultButton, PrimaryButton } from 'office-ui-fabric-react/lib/Button';
import SelectionItemExample from './ParagraphsSelect';
import { insertHtmlAfterParagraph } from '../../utils/WordUtil';
import { parse } from 'query-string';

import './styles.less';

interface Props {
  showModal?: boolean
  onChange?: Function
  location?: any
  id: string
  type: string
}

export class DocumentAssistDialog extends React.Component<Props,
  {
    showModal: boolean,
    selectDatas: any[],
    search: any
  }
  > {
  constructor(props: Props) {
    super(props);

    const search = parse(props.location.search)
    this.state = {
      showModal: props.showModal || false,
      selectDatas: [],
      search
    };
  }


  public render(): JSX.Element {
    const { id, type } = this.state.search
    const { selectDatas } = this.state
    console.info('历史', id, type)
    return (
      <div className="word-dialog ms-clearfix dialog-viewpage container">

        <SelectionItemExample id={id} type={type} />

      </div>
    );
  }

}

export default withRouter(DocumentAssistDialog)
